Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Save last patched app #1414

Merged
merged 40 commits into from
Jun 29, 2024
Merged

feat: Save last patched app #1414

merged 40 commits into from
Jun 29, 2024

Conversation

BenjaminHalko
Copy link
Member

closes: #643

Adds patch history: It will keep the last 3 APKs of the patched packages. The user can then install or export it.

The UI could use a bit of work though. Right now if you click on the app in the history menu, it will let you install or export. If you open it in the installed app list you get the option to open / uninstall the app like before.

The reason for the 2 separate menus is for the case where someone patches the app, then closes manager without installing. It would be nice to be able to go back and install it. Thus it needs a separate entry from the version that is currently installed on the system.

The history is limited to the 3 most recent packages because it has to keep the patched apk for every entry which uses up space.

Example where Twitch was compiled but not installed, and where Repair Toolkit was compiled and installed:

Screen_Recording_20231021_131516_ReVanced.Manager.Debug.mp4

@Ushie
Copy link
Member

Ushie commented Oct 21, 2023

You may be interested in adding chips to switch between those cards, look at older versions of revanced manager before the removal of the "update" WIP card

@validcube
Copy link
Member

Now we need "delete stored APK" in settings!!!!

@oSumAtrIX
Copy link
Member

This feature requires enhanced transparency. Users should be able to create a backup of the patched app once the patching process is complete. This could lead to significant storage consumption for each patched app by default. A checkbox labelled "Save a copy" should be included within the installation dialogue, accompanied by the subtitle: "A copy of the patched app will be saved, which can be installed or exported in the future. You can manage these copies in the 'Patched apps' section located in the main menu of ReVanced Manager." As suggested by @validcube, it is advisable to provide the option to delete saved APKs, preferably within the same interface where users can install, export, or manage the patched app. A submenu displaying the list of saved patched apps, their patching date, and metadata, including applied patches, should be available for that.

If the user checks the checkmark to save the patched app, but a saved patched app of the same version is already present, give the user the option to overwrite any existing saved app.

The installation button in the patched app view has to show the same popup as the one after patching, as you may want to mount the app.

@BenjaminHalko
Copy link
Member Author

BenjaminHalko commented Oct 22, 2023

This could lead to significant storage consumption for each patched app by default

I propose we only save the last 3 packages, plus there could be a button in the app history to delete it. This button could be beside the install and export button, on the same row.

A checkbox labelled "Save a copy" should be included within the installation dialogue, accompanied by the subtitle: "A copy of the patched app will be saved, which can be installed or exported in the future. You can manage these copies in the 'Patched apps' section located in the main menu of ReVanced Manager."

How about just a toggle in the settings menu. I feel like the patch history should be used for the event where a user forgets to either export or install an app. There have been a few times where I have forgot to export my apk and then needed to repatch it. But never an event where I wanted the manager to save it for me. If I needed it saved, I just exported the apk. If I had to click a checkbox every time I wanted the app to save the apk, that would defeat the point of having the app save a backup. If I remembered to click a checkbox then I will have remembered to export the apk.

The installation button in the patched app view has to show the same popup as the one after patching, as you may want to mount the app.

Already should do that, though I don't have root so I can't test that out.

@oSumAtrIX
Copy link
Member

I propose we only save the last 3 packages

How about using that as a maximum, but still inform the user about being able to overwrite the last saved patched app via a checkmark if a patched app is already saved? That way the user can replace their last saved patched app every time they successfully patch without having to manually clean up.

If I remembered to click a checkbox then I will have remembered to export the apk.

In this case, how about checking it by default. Having to visit the settings to toggle it, would be difficult right from the patch result screen.

@BenjaminHalko
Copy link
Member Author

The "3 packages" limit would be 3 different packages. If you patch youtube it would replace youtube in the history automatically. If the youtube package was not in the history it would bump the oldest package off the history.

Although, thinking about it now, since the patch history is for "if the user forgets to preform an action once finished patching" it might be simpler to save ONLY the last patched apk. There isn't really a need to save more than that.

@BenjaminHalko BenjaminHalko marked this pull request as draft October 25, 2023 01:49
@oSumAtrIX
Copy link
Member

There isn't really a need to save more than that.

Yeah, 1 backup per app should be enough, saving the last patched app only (give the user the choice not to), should be good too.

# Conflicts:
#	lib/models/patch.dart
#	lib/services/patcher_api.dart
#	pubspec.yaml
@oSumAtrIX
Copy link
Member

#1414 (review)

Has this been resolved?

@ILoveOpenSourceApplications

#1414 (review)

Has this been resolved?

@BenjaminHalko ?

@BenjaminHalko
Copy link
Member Author

@ILoveOpenSourceApplications I'll check tmr.

I think some text just needs to be changed.

@oSumAtrIX oSumAtrIX changed the title feat: patch history feat: Save history for patched apps Jun 27, 2024
@oSumAtrIX oSumAtrIX changed the title feat: Save history for patched apps feat: Save history of patched apps Jun 27, 2024
@oSumAtrIX oSumAtrIX changed the title feat: Save history of patched apps feat: Save last patched app Jun 27, 2024
@oSumAtrIX
Copy link
Member

oSumAtrIX commented Jun 27, 2024

Is it possible to display how much storage the last saved patched app takes? Preferably here:

image

and here:

image

android/settings.gradle Outdated Show resolved Hide resolved
@BenjaminHalko
Copy link
Member Author

Screenshot_20240628-094156_ReVanced Manager Debug

assets/i18n/strings.i18n.json Outdated Show resolved Hide resolved
lib/services/manager_api.dart Outdated Show resolved Hide resolved
assets/i18n/strings.i18n.json Outdated Show resolved Hide resolved
lib/ui/widgets/homeView/last_patched_app_card.dart Outdated Show resolved Hide resolved
@oSumAtrIX oSumAtrIX merged commit 7720408 into dev Jun 29, 2024
1 check passed
@oSumAtrIX oSumAtrIX deleted the feat/patch-history branch June 29, 2024 12:38
github-actions bot pushed a commit that referenced this pull request Jun 30, 2024
# [1.21.0-dev.6](v1.21.0-dev.5...v1.21.0-dev.6) (2024-06-30)

### Bug Fixes

* Add missing import to patch options field ([d60f9aa](d60f9aa))
* Follow system theme immediately ([#1942](#1942)) ([694f2a9](694f2a9))
* Handle selecting files and folders for patch options correctly ([#1941](#1941)) ([b26760b](b26760b))
* Increase dashboard RefreshIndicator edge offset ([#1859](#1859)) ([232b702](232b702))
* Select previously applied patches when loading patch selection ([#1865](#1865)) ([7ef8f04](7ef8f04))
* Unsupported patch toast says "patchItem.unsupportedPatchVersion" ([#2011](#2011)) ([3209c0e](3209c0e))

### Features

* Save last patched app ([#1414](#1414)) ([7720408](7720408))
github-actions bot pushed a commit that referenced this pull request Jul 29, 2024
# [1.21.0](v1.20.1...v1.21.0) (2024-07-29)

### Bug Fixes

* Add missing import to patch options field ([d60f9aa](d60f9aa))
* Adjust scroll from clipping children form fields in `AlertDialog` from `showSourcesDialog` ([#1782](#1782)) ([bbeb836](bbeb836))
* Cache external API calls  ([#1911](#1911)) ([2c3e2e6](2c3e2e6))
* Change problematic translation string ([6b03f3a](6b03f3a))
* Correct architecture to armeabi-v7a ([63c6412](63c6412))
* Download latest integrations non-pre-release ([4a72267](4a72267))
* Follow language update immediately ([#1944](#1944)) ([c13827e](c13827e))
* Follow system theme immediately ([#1942](#1942)) ([694f2a9](694f2a9))
* Handle selecting files and folders for patch options correctly ([#1941](#1941)) ([b26760b](b26760b))
* Increase dashboard RefreshIndicator edge offset ([#1859](#1859)) ([232b702](232b702))
* Patching Screen draw-behind Navigation Bar ([#1945](#1945)) ([f1b25d0](f1b25d0))
* Restore consistency with the app ([ea9654e](ea9654e))
* SecurityException when patching application ([#1856](#1856)) ([e0a6de2](e0a6de2))
* Select previously applied patches when loading patch selection ([#1865](#1865)) ([7ef8f04](7ef8f04))
* Unable to install application regardless of preference ([c7627ce](c7627ce))
* Unsupported patch toast says "patchItem.unsupportedPatchVersion" ([#2011](#2011)) ([3209c0e](3209c0e))
* Update dialog shows dev version & loading gets stuck in certain circumstances ([#1792](#1792)) ([fc52560](fc52560))

### Features

* Add ability to set `null` in patch options ([#1947](#1947)) ([5c68d51](5c68d51))
* Include primary architecture in external search ([#2068](#2068)) ([23690a9](23690a9))
* open browser when clicking on changelog link ([bc300d8](bc300d8))
* Save last patched app ([#1414](#1414)) ([7720408](7720408))
* Support patching on ARMv7a ([a766352](a766352))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants